#include <ptgui/ptgui.h>

const static char *file_xpm[] =
{
	"16 16 21 1",
	" 	c None",
	".	c #999999",
	"+	c #818181",
	"@	c #FFFFFF",
	"#	c #ECECEC",
	"$	c #EAEAEA",
	"%	c #EBEBEB",
	"&	c #EDEDED",
	"*	c #F0F0F0",
	"=	c #C4C4C4",
	"-	c #C5C5C5",
	";	c #C6C6C6",
	">	c #C7C7C7",
	",	c #EEEEEE",
	"'	c #EDEDE5",
	")	c #EDEDE6",
	"!	c #EFEFEF",
	"~	c #C8C8C8",
	"{	c #F1F1F1",
	"]	c #F2F2F2",
	"^	c #959595",
	".++++++++++++   ",
	"+@@@@@@@@@@@@+  ",
	"+@#$$%%%##&*@+  ",
	"+@$=--;;;;>*@+  ",
	"+@$%%###&&,*@+  ",
	"+@%-;;;;;;>*@+  ",
	"+@%%##&&'#,*@+  ",
	"+@%;;;;,,),*@+  ",
	"+@##&&,,!!!*@+  ",
	"+@#;;;>>~~~*@+  ",
	"+@#&,,!!*{{{@+  ",
	"+@&;>>~~~{{]@+  ",
	"+@&&,!!**{]]@+  ",
	"+@@@@@@@@@@@@+  ",
	"^++++++++++++^  ",
	"                "
};

static ptgui_image_t *file_image;
static ptgui_surface_t *surface;
static ptgui_widget_t *widget;

static ptgui_gui_t gui;

int rt_application_init()
{
	ptgui_rect_t rect;
	ptgui_gui_init(&gui);

	file_image = ptgui_image_create_from_mem("xpm", (rt_uint8_t *)file_xpm, sizeof(file_xpm), RT_TRUE);
	surface = ptgui_surface_create_image(file_image);
	widget = ptgui_widget_create(PTGUI_WIDGET_TYPE);				
	ptgui_widget_set_surface(PTGUI_WIDGET(widget), surface);

	ptgui_graphic_driver_get_default_rect(&rect);

	ptgui_widget_set_rect(PTGUI_WIDGET(widget), &rect);

	ptgui_gui_add(&gui, PTGUI_WIDGET(widget));

	ptgui_gui_render(&gui);
	return 0;
}

